using UnityEngine;
// [Assembly-CSharp.dll].Ballone
public class Ballone : MonoBehaviour
{
    // Fields
    private float target;
    private float speed;
    private UnityEngine.Transform[] dogs;
    private float[] offsets;
    private UnityEngine.GameObject deathVfx;
    
    // Methods
    private void Start()
    {
        var val_5 = 0;
        label_8:
        if(val_5 >= this.dogs.Length)
        {
                return;
        }
        
        UnityEngine.Vector3 val_2 = this.transform.position;
        if(val_5 >= this.dogs.Length)
        {
            goto label_7;
        }
        
        UnityEngine.Vector3 val_3 = this.dogs[val_5].position;
        if(val_5 >= this.offsets.Length)
        {
            goto label_7;
        }
        
        this.offsets[val_5] = val_2.y - val_3.y;
        val_5 = val_5 + 1;
        if(this.dogs != null)
        {
            goto label_8;
        }
        
        throw new NullReferenceException();
        label_7:
    }
    private void Update()
    {
        UnityEngine.Transform val_17;
        float val_18;
        float val_19;
        float val_20;
        float val_21;
        val_17 = this.transform;
        UnityEngine.Vector3 val_3 = this.transform.localPosition;
        UnityEngine.Vector3 val_5 = this.transform.localPosition;
        val_18 = this.target;
        val_19 = val_5.x;
        val_20 = UnityEngine.Time.deltaTime;
        float val_7 = val_19 - val_3.x;
        float val_8 = val_18 - val_3.y;
        val_21 = (val_7 * val_7) + (val_8 * val_8);
        if(val_21 == 0f)
        {
            goto label_6;
        }
        
        val_20 = this.speed * val_20;
        if(val_20 < 0f)
        {
            goto label_5;
        }
        
        float val_11 = val_20 * val_20;
        if(val_21 <= val_11)
        {
            goto label_6;
        }
        
        label_5:
        float val_12 = val_7 / val_11;
        val_11 = val_8 / val_11;
        val_12 = val_20 * val_12;
        val_11 = val_20 * val_11;
        val_19 = val_3.x + val_12;
        val_18 = val_3.y + val_11;
        label_6:
        val_17.localPosition = new UnityEngine.Vector3() {x = val_19, y = val_18, z = 0f};
        if((mem[536886749] + 72) == 1)
        {
                return;
        }
        
        var val_18 = 0;
        label_19:
        if(val_18 >= this.dogs.Length)
        {
                return;
        }
        
        if(val_18 >= this.dogs.Length)
        {
            goto label_18;
        }
        
        val_17 = this.dogs[val_18];
        UnityEngine.Vector3 val_14 = val_17.transform.position;
        val_21 = val_14.x;
        UnityEngine.Vector3 val_16 = this.transform.position;
        if(val_18 >= this.offsets.Length)
        {
            goto label_18;
        }
        
        val_16.y = val_16.y - this.offsets[val_18];
        val_17.position = new UnityEngine.Vector3() {x = val_21, y = val_16.y, z = 0f};
        val_18 = val_18 + 1;
        if(this.dogs != null)
        {
            goto label_19;
        }
        
        throw new NullReferenceException();
        label_18:
    }
    private void OnCollisionEnter2D(UnityEngine.Collision2D collision)
    {
        if(((collision.gameObject.CompareTag(tag:  -1610609439)) != true) && ((collision.gameObject.CompareTag(tag:  -1610605751)) != true))
        {
                if((collision.gameObject.CompareTag(tag:  -1610603609)) != true)
        {
                if((collision.gameObject.CompareTag(tag:  -1610601399)) == false)
        {
                return;
        }
        
        }
        
        }
        
        mem[536886749].ActiveDog();
        UnityEngine.Object.Destroy(obj:  this.gameObject);
        UnityEngine.Vector3 val_11 = this.transform.position;
        Unknown val_12 = UnityEngine.Object.Instantiate<System.Object>(original:  this.deathVfx, position:  new UnityEngine.Vector3() {x = val_11.x, y = val_11.y, z = val_11.z}, rotation:  new UnityEngine.Quaternion() {x = mem[536891277], y = mem[536891277] + 4, z = mem[536891277] + 8, w = mem[536891277] + 8 + 4});
    }
    public Ballone()
    {
        this.target = 10f;
        this.speed = 1f;
    }

}
